<template>
    <div>
        <h2>vue2组件测试</h2>
        <h1>{{ msg }}</h1> 
        <p>{{ num }}</p>
        <input type="text" v-model="num" />
        <button @click="add">+1</button>
    </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'

export default defineComponent({
    data() {
        return {
            msg: '今天很冷',
            num: 0
        }
    },
    methods : {
        add(){
            this.num += 1;
        }
    }
})
</script>

<style scoped>

</style>